import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsPhoneNumber, IsString } from 'class-validator';

export class CreateUserDto {
  @ApiProperty({ description: '手机号/账号' })
  @IsNotEmpty({ message: '账号不能为空' })
  @IsString()
  @IsPhoneNumber()
  phone: string;

  @ApiProperty({ description: '密码' })
  @IsNotEmpty({ message: '密码不能为空' })
  @IsString()
  password: string;

  @ApiProperty({ description: '昵称' })
  @IsNotEmpty({ message: '昵称不能为空' })
  @IsString()
  nick: string;

  @ApiProperty({ description: '性别' })
  @IsString()
  sex?: string;

  @ApiProperty({ description: '出生日期' })
  @IsString()
  birthday?: string;

  @ApiProperty({ description: '个性签名' })
  @IsString()
  sign?: string;
}
